import {basePostRequest, postRequest, getRequest} from '@/common/request'
import {urls} from './url'

const loginApi = urls.login

export function login(t, username, password, success, error, compelete) {
  basePostRequest(loginApi.signin, {t}, {username, password}, success, error, compelete)
}

export function getInfo(token, success, compelete) {
  getRequest(loginApi.getInfo + token, {}, success, compelete)
}

export function logout(success, compelete) {
  getRequest(loginApi.logout, {}, success, compelete)
}
